package com.itheima.health.controller;

import com.itheima.health.common.MessageConst;
import com.itheima.health.entity.Result;
import com.itheima.health.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;


/**
 * 移动端订单数据控制层
 *
 * @author dwj
 * @since 2023/4/28 10:43
 */
@RestController
@RequestMapping("/mobile/order")
@Slf4j
public class MobileOrderController {

    @Autowired
    private OrderService orderService;
    /**
     *根据id查询
     */
    @GetMapping("findById")
    public Result findById(Integer id) {
        log.info("前后端连通");
        Map map = orderService.findById(id);
        return new Result(true, MessageConst.QUERY_ORDER_SUCCESS, map);
    }
}
